

Type ResourceManagerTest Extends TTest

	Field m:TResources
	Field testImage:TImage = LoadImage("media\ship.png")
	
	
	Method before() {before}
		m = New TResources
	End Method
	
	Method After() {after}
		m = Null
	End Method
	
		
	Method Constructor() {test}
		assertNotNull(m)
		assertNotNull(m._resources, "no map")
		assertNull(m.GetGroup("default"), "no default group")
	End Method
	
	
	Method AddandGetGroup() {test}
		m.AddGroup("test")
		assertNotNull(m.GetGroup("test"))
	End Method
	
	
	Method SetAndGetImage() {test}
		m.StoreImage(testImage, "ship")
		assertNotNull(m.GetImage("ship"), "should work")
		assertNotNull(m.GetImage("ship", "default"), "should also work")
		
		assertNull(m.Getimage("ship", "tst"), "wrong group name")
		assertNull(m.Getimage("shp", "test"), "wrong image name")
	End Method
	
End Type

